<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:param name="guid" />
  <xsl:param name="id" />
	<xsl:param name="showIndex" select="0" />
	<xsl:param name="currentUrl" />
  <xsl:param name="xhtmlContent" select="c" />
	
	<xsl:output method="html"/>
	
<xsl:template match="/">
    <html>
		<head>
<meta name="verify-v1" content="KbbvHijn15o2ym4gy3W0rVP1+ljMhgYg7OG4vci37+c=" />
			<title>Collis Studios</title>
			<link href="@templatepath@/default.css" rel="stylesheet" type="text/css" />
			<link rel="alternate" type="application/rss xml" title="RSS" href="/feeds/rss20" />
			<style>
				.c_nonav
				{
				float:left;
				width:auto;
				}
				
				.c_nav
				{
				float:left;
				width:560px;
				}
			</style>
		</head>
    <body>
    <div id="page">
    <div id="header"><div id="topleft"></div><div id="topright"></div><a href="./"><h1>Collis Studios</h1></a></div>
    <div id="navigation">
        <div id="info" class="ni"><a href="/AboutCollisStudios.t"><img src="@templatepath@/Images/nav_information.gif" /></a></div>
        <div id="julie" class="ni"><a href="/JulieCollis.t"><img src="@templatepath@/Images/nav_julie.gif" /></a></div>
        <div id="peter" class="ni"><a href="/PeterCollis.t"><img src="@templatepath@/Images/nav_peter.gif" /></a></div>
        <div id="contact" class="ni" style="border:0;"><a href="/contact.aspx"><img src="@templatepath@/Images/nav_contact.gif" /></a></div>
    </div>
	<div id="content">
    <xsl:choose>
      <xsl:when test="$xhtmlContent='-'">
        <xsl:apply-templates select="//webpage[($id='' and @homepage='1') or ($id=@id)]" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$xhtmlContent"/>
      </xsl:otherwise>
    </xsl:choose>
	</div>
    <div id="footer">
        <p>2004-2007 Collis Studios</p>
        <p>Site by <a href="http://www.tanash.net" target="_blank">Tanash</a></p>
        <p>Subscribe: <a href="/feeds/rss20">RSS 2.0</a> | <a href="/feeds/atom">Atom</a></p>
    </div>
    </div>
	<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
	</script>
	<script type="text/javascript">
	_uacct = "UA-1910282-3";
	urchinTracker();
	</script>
    </body>
    </html>
</xsl:template>

	<xsl:template match="webpage">
		<xsl:choose>
		  <xsl:when test="@key != 'default' and $showIndex=1">
		    <div id="pageindex">
			    <ul>
				    <xsl:apply-templates select="/website/navigation" />
			    </ul>
		    </div>
		    <div class="c_nav">
			    <xsl:value-of select="node()"/>
		    </div>
		  </xsl:when>
		  <xsl:otherwise>
			  <div class="c_nonav">
		      <xsl:value-of select="node()"/>
	      </div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template match="/website/navigation">
			<xsl:element name="li">
				<xsl:element name="h2">
					<xsl:element name="a">
						<xsl:attribute name="class">
							root<xsl:if test="string($currentUrl)=string(@navigateURL)"> selected</xsl:if>
						</xsl:attribute>
						<xsl:attribute name="href">
							<xsl:value-of select="@navigateURL"/>
						</xsl:attribute>
						<xsl:value-of select="text()"/>
					</xsl:element>
					<xsl:if test="./navigation/node()">
						<xsl:element name="ul">
							<xsl:apply-templates select="./navigation">
							</xsl:apply-templates>
						</xsl:element>
					</xsl:if>
				</xsl:element>
			</xsl:element>
	</xsl:template> 

<xsl:template match="page[@guid='contactform']">
<script type="text/javascript" src="scripts/prototype.js"></script>
<script type="text/javascript" src="scripts/SiteServices.js"></script>
<script type="text/javascript">
function c()
{
    var tName=$('yourName');
    var tEmail=$('yourEmail');
    var tMessage=$('message');
    contactUs(1,tName.value,tEmail.value,tMessage.value,cSuccess,cFailed);
}

function cSuccess(transport)
{
alert('success');
}

function cFailed(transport)
{
alert('failed');
}
</script>
<div id="contactform">
Your Name: : <input type="text" id="yourName" /><br />
Your Email: <input type="text" id="yourEmail" /><br />
Your Message: <input type="text" id="message" /><br />
<input type="button" id="btnSend" value="Send Comment" onclick="c();" />
</div>

</xsl:template>

</xsl:stylesheet> 

